package a.d.b;

import java.util.ArrayList;
import java.util.Comparator;

public class a
{
  public static final int a = 0;
  public static final int b = 1;
  public static final int c = 0;
  public static final int d = 1;
  public static final int e = 2;
  protected r f;
  private Object[] g;
  private Object[] h;
  private Object i;
  private Object j;
  private Object l;
  private Object m;
  int n;
  public static int o;
  
  public a(Object[] paramArrayOfObject, boolean paramBoolean, r paramr)
  {
    this.f = paramr;
    int k = 0;
    int i1 = a(paramArrayOfObject);
    if (!bool2)
    {
      if (paramBoolean)
      {
        this.n = i1;
        if (bool2) {
          break label75;
        }
        if (!bool1) {}
      }
      else
      {
        this.n = 0;
      }
    }
    else
    {
      if (bool2) {
        break label75;
      }
      if (i1 == 1) {
        k = 1;
      }
    }
    label75:
    int i2 = paramArrayOfObject.length;
    this.g = new Object[i2];
    this.h = new Object[i2];
    Comparator localComparator1 = this.f.b();
    Comparator localComparator2 = this.f.d();
    this.i = paramArrayOfObject[0];
    this.j = paramArrayOfObject[0];
    this.l = paramArrayOfObject[0];
    this.m = paramArrayOfObject[0];
    int i3 = 0;
    label276:
    do
    {
      if (i3 >= i2) {
        break;
      }
      Object localObject = paramArrayOfObject[i3];
      if (!bool2)
      {
        if (k != 0)
        {
          this.g[(i2 - i3 - 1)] = localObject;
          this.h[(i2 - i3 - 1)] = this.f.e(localObject, paramArrayOfObject[((i3 - 1) % i2)]);
          if (bool2) {
            break label276;
          }
          if (!bool1) {}
        }
        else
        {
          this.g[i3] = localObject;
        }
      }
      else {
        this.h[i3] = this.f.e(localObject, paramArrayOfObject[((i3 + 1) % i2)]);
      }
      if (!bool2) {
        if (localComparator1.compare(localObject, this.i) < 0) {
          this.i = localObject;
        }
      }
      if (!bool2) {
        if (localComparator1.compare(localObject, this.j) > 0) {
          this.j = localObject;
        }
      }
      if (!bool2) {
        if (localComparator2.compare(localObject, this.l) < 0) {
          this.l = localObject;
        }
      }
      if (!bool2)
      {
        if (localComparator2.compare(localObject, this.m) > 0) {
          this.m = localObject;
        }
        i3++;
      }
    } while (!bool1);
  }
  
  public int a(Object paramObject)
  {
    boolean bool2 = e.b;
    boolean bool1 = e.a;
    Comparator localComparator1 = this.f.a();
    int k = localComparator1.compare(paramObject, this.i);
    int i1 = localComparator1.compare(paramObject, this.j);
    int i2 = localComparator1.compare(paramObject, this.l);
    int i3 = localComparator1.compare(paramObject, this.m);
    if (!bool2) {
      if (k >= 0)
      {
        if (bool2) {
          break label111;
        }
        if (i1 <= 0)
        {
          if (bool2) {
            break label111;
          }
          if (i2 >= 0)
          {
            if (bool2) {
              break label113;
            }
            if (i3 <= 0) {
              break label112;
            }
          }
        }
      }
    }
    label111:
    return 2;
    label112:
    label113:
    int i4 = 0;
    if (i4 < this.h.length) {}
    while (bool2)
    {
      if (bool1) {
        break label174;
      }
      if (!bool2)
      {
        if (this.f.h(this.h[i4], paramObject)) {
          return 0;
        }
        i4++;
      }
      if (!bool1) {
        break;
      }
    }
    label174:
    Comparator localComparator2 = this.f.b();
    int i5 = 0;
    int i6 = 0;
    do
    {
      do
      {
        if (i6 >= this.h.length) {
          break;
        }
        Object localObject1 = this.h[i6];
        Object localObject2 = this.f.c(localObject1);
        Object localObject3 = this.f.d(localObject1);
        int i7 = localComparator2.compare(localObject2, localObject3);
        if (bool1) {
          break label358;
        }
        if (i7 != 0)
        {
          if (!bool2) {
            if (i7 > 0)
            {
              Object localObject4 = localObject2;
              localObject2 = localObject3;
              localObject3 = localObject4;
            }
          }
          if (bool2) {
            continue;
          }
          if (localComparator2.compare(localObject2, paramObject) <= 0)
          {
            if (bool2) {
              continue;
            }
            if (localComparator2.compare(paramObject, localObject3) < 0)
            {
              if (bool2) {
                continue;
              }
              if (this.f.a(localObject2, localObject3, paramObject) < 0) {
                i5++;
              }
            }
          }
        }
        i6++;
      } while (!bool1);
    } while (bool2);
    label358:
    return i5 % 2 == 0 ? 2 : 1;
  }
  
  public int c(Object paramObject)
  {
    boolean bool = e.b;
    int k = a(paramObject);
    if (!bool) {}
    switch (k)
    {
    case 1: 
      if (!bool) {}
      return this.n == 0 ? 1 : -1;
    case 2: 
      if (!bool) {}
      return this.n == 0 ? -1 : 1;
    case 0: 
      return 0;
    }
    throw new RuntimeException("Illegal return value of regionOf: " + k);
  }
  
  public Object[] e(Object paramObject)
  {
    boolean bool2 = e.b;
    boolean bool1 = e.a;
    ArrayList localArrayList = new ArrayList();
    int k = 0;
    if (k < this.h.length) {}
    while (bool2)
    {
      Object localObject = this.f.f(paramObject, this.h[k]);
      if (!bool2)
      {
        if (localObject != null) {
          localArrayList.add(localObject);
        }
        k++;
      }
      if (!bool1) {
        break;
      }
    }
    return localArrayList.toArray();
  }
  
  public int a()
  {
    return this.n;
  }
  
  protected int a(Object[] paramArrayOfObject)
  {
    boolean bool2 = e.b;
    boolean bool1 = e.a;
    int k = paramArrayOfObject.length;
    Object localObject1 = paramArrayOfObject[0];
    int i1 = 0;
    Comparator localComparator = this.f.a();
    int i2 = 1;
    do
    {
      if (i2 >= k) {
        break;
      }
      localObject2 = paramArrayOfObject[i2];
      if (bool1) {
        break label86;
      }
      if (localComparator.compare(localObject2, localObject1) < 0)
      {
        localObject1 = localObject2;
        i1 = i2;
      }
      i2++;
    } while (!bool1);
    label86:
    i2 = (!bool2) && (i1 > 0) ? i1 - 1 : paramArrayOfObject.length - 1;
    Object localObject2 = paramArrayOfObject[i2];
    int i3 = 0;
    do
    {
      Object localObject3;
      do
      {
        localObject3 = paramArrayOfObject[(i1++ % k)];
        i3 = this.f.a(localObject2, localObject1, localObject3);
        if (i3 != 0) {
          break;
        }
      } while (localObject3 != localObject2);
    } while (bool1);
    return i3 >= 0 ? 0 : 1;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.d.b.a
 * JD-Core Version:    0.7.0.1
 */